package cn.iocoder.yudao.module.member.eid.dal.mysql;

import cn.iocoder.yudao.framework.business.basic.dao.mapper.CoreMapper;
import cn.iocoder.yudao.framework.business.basic.dao.query.CoreLambdaQueryWrapper;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.eid.dal.dataobject.MemberEidDO;
import cn.iocoder.yudao.module.member.eid.vo.EidPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 实名信息 Mapper
 *
 * @author 山野羡民
 */
@Mapper
public interface MemberEidMapper extends CoreMapper<MemberEidDO> {

    default PageResult<MemberEidDO> selectPage(EidPageReqVO reqVO) {
        return selectPage(reqVO, new CoreLambdaQueryWrapper<MemberEidDO>()
                .likeIfPresent(MemberEidDO::getRealName, reqVO.getRealName())
                .eqIfPresent(MemberEidDO::getIdcardNo, reqVO.getIdcardNo())
                .betweenIfPresent(MemberEidDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(MemberEidDO::getAddress, reqVO.getAddress())
                .eqIfPresent(MemberEidDO::getSex, reqVO.getSex())
                .eqIfPresent(MemberEidDO::getStatus, reqVO.getStatus())
                .orderByDesc(MemberEidDO::getId));
    }

}
